# map

lsit_x = [1,2,3,4,5,6]
list_y = [1,2,3,4,5,6,7]

def square(x):
    return x*x
for x in lsit_x:
    print(square(x))
# 使用map的实现
r = map(square,lsit_x)
print(list(r))

# lambda+map实现
c = map(lambda x: x*x,lsit_x)
print(list(c))

# 多值不同长度时，取长度短的进行运算，多出来的不管。
beanTwo = map(lambda x,y: x*x + y,lsit_x,list_y)
print(list(beanTwo))